/* 
 *  Copyright (C) 2006 James Young
 * `gurumind(a)gmail.com
 * 
 */

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace IPDEditor
{
    public partial class IPDEditorServiceBook : IPDEditor.IPDEditorBase
    {
        public IPDEditorServiceBook()
        {
            InitializeComponent();
        }

        private void IPDEditorServiceBook_Load(object sender, EventArgs e)
        {
            tbeLabel.Text = "Service Book Visual Editor";
        }

        public override void FillData(IPDDatabase record)
        {
            IPDServiceBook sb = (IPDServiceBook)record;

            tbRecordType.Text = sb.RecordType.ToString();
            tbName.Text = sb.Name;
            tbUID.Text = sb.UID;
            tbCID.Text = sb.CID;
            tbUserID.Text = sb.UserID.ToString();
            //tbDescription.Text = sb.Desciption;
        }

        protected override void Save()
        {
            IPDServiceBook sb = (IPDServiceBook)_vr.record;

            sb.RecordType = int.Parse(tbRecordType.Text);
            sb.Name = tbName.Text;
            sb.UID = tbUID.Text;
            sb.CID = tbCID.Text;
            sb.UserID = int.Parse(tbUserID.Text);
            sb.Desciption = tbDescription.Text;
        }
    }
}

